package com.xiaoxi.yygh.common.exception;

import com.xiaoxi.yygh.common.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    
    @ExceptionHandler(value = Exception.class)
    public Result error(Exception e){
        e.printStackTrace();
        
        return Result.fail();
    }
    
    @ExceptionHandler(value = YyghException.class)
    public Result error(YyghException e){
        e.printStackTrace();
        
        return Result.fail();
    }
}
